public class AddOp extends ArithmeticOp
{
	public AddOp() {
		super("+");
	}

	@Override
	public STO calculate(ConstSTO left, ConstSTO right) {
		ConstSTO sto;
		if(left.getType().isInt() && right.getType().isInt()) {
			sto = new ConstSTO((left.getName() + "+" + right.getName()), new IntType(), 
				  Integer.toString(left.getIntValue() + right.getIntValue()));
		}
		else {
			sto = new ConstSTO((left.getName() + "+" + right.getName()), new FloatType(), 
					  Double.toString(left.getFloatValue() + right.getFloatValue()));
		}
		return sto;
	}
	
	@Override
	public boolean isAddOp() {
		return true;
	}
}
